<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./download/font_3366928_u09i2suco8/iconfont.css">
    <link rel="stylesheet" href="./css/品牌列表.css">
    
    <script src="./js/jquery.min.js"></script>

    <style>
      
    </style>
</head>
<body>
    <div class="he">万峰智慧</div>
    <input placeholder="请输入您想比价的产品">
    <button class="btn">搜索</button>
    
 <ul class="ull">
 <!-- <li>平板电视</li>
 <li>液晶电视</li>
 <li>led电视</li>
 <li>等离子电视</li>
 <li>3d电视</li> -->

 
 </ul>

 <button class="btn1">更多优惠信息 >>></button>
 <div class="pin">品牌排行

    <i class="iconfont icon-youjiantou3"></i>
 </div>

 <div class="bot">
    <span>登入</span>
    <span>注册</span>
    <span>返回顶部</span>
 </div>

 <span class="pp1">手机app下载 万峰智慧商城手机版 -- 掌上比价平台</span>
 <span class="pp2">chast.vip.8081/.com</span>
</body>

<script>
    let xhr=new XMLHttpRequest()
    // var arr=[]
    var ull=document.querySelector('.ull')
    var ll=document.querySelectorAll('.ull li')
    xhr.open('get',"http://chst.vip:1234/api/getbrandtitle",true,)
    xhr.onload=function(){
        if(xhr.status===200){
            var res=JSON.parse(xhr.responseText)
            // console.log(res.result)
            var lis=''
            res.result.forEach(ele => {
             lis+=`
             <li brandtitleid='${ele.brandTitleId}'>${ele.brandTitle}
               <i class="iconfont icon-shouye1"></i>
                
                </li>

             `
            //  arr.push(ele.brandTitleId)
             
            });
            ull.innerHTML=lis
     
         }
     


        }

    
    xhr.send(null)

ull.onclick=function(ev){
    let e=ev||window.event

    let target=e.target||e.srcElement
    console.log(target.nodeName);

    if(target.nodeName==='LI'){
        localStorage.setItem('brandtitleId',target.getAttribute('brandtitleid'))
    }
    location.href='./商品列表跳转1.html'
}



var ding=document.querySelector('.bot span:nth-of-type(3)')

ding.style.color='#c36'
ding.onclick=function(){
    document.documentElement.scrollTop=0
}


  


      

</script>
</html>